﻿using MaterialDesignThemes.Wpf;
using System.Windows;
using System.Windows.Controls;

namespace project.B12.Views.Dialog
{
    /// <summary>
    /// AboutView.xaml 的交互逻辑
    /// </summary>
    public partial class AboutView : UserControl
    {
        public AboutView()
        {
            InitializeComponent();
        }
        public static void ComfirmAbout(string Title, string VersionNum, string dialogHostName = "Main")
        {
            if (DialogHost.IsDialogOpen(dialogHostName))
                return;
            var aboutView = new AboutView
            {
                MessageTitle = { Text = Title },
                NameContent = { Text = Title },
                Version = { Text = VersionNum },
                DialogHostName = dialogHostName,
            };
            DialogHost.Show(aboutView, dialogHostName);
        }

        public string DialogHostName { get; internal set; }
        private void Button_Click(object sender, RoutedEventArgs e)
        {
            if (DialogHost.IsDialogOpen(DialogHostName))
                DialogHost.Close(DialogHostName, true);
        }
    }
}
